package com.supor.nfc.lib.common;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * ---------------------------------------------------------------- <br>
 * Copyright (C) 2014-2020, by het, Shenzhen, All rights reserved.  <br>
 * ---------------------------------------------------------------- <br>
 * <p>
 * 描述: ParamInfo <br>
 * 作者: lei <br>
 * 日期: 2020/9/7 <br>
 */
public class ParamInfo implements Parcelable {
    /**
     * 方法标识ID, 功能(1)
     */
    public short funName;
    /**
     * 火力℃(2bytes)
     */
    public short fire;
    /**
     * 压力KP(1byte)
     */
    public short press;
    /**
     * 功率(1byte)
     */
    public short power;
    /**
     * 搅拌(1byte)
     */
    public short stir;
    /**
     * 正反转(1byte)
     */
    public short reverse;
    /**
     * 排气(1byte)
     */
    public short venting;
    /**
     * 时间(3byte,单位S)
     */
    public int time;
    /**
     * 结束条件
     */
    public byte condition;

    public ParamInfo() {
    }

    public static final Creator<ParamInfo> CREATOR = new Creator<ParamInfo>() {
        @Override
        public ParamInfo createFromParcel(Parcel in) {
            return new ParamInfo(in);
        }

        @Override
        public ParamInfo[] newArray(int size) {
            return new ParamInfo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.funName);
        dest.writeInt(this.fire);
        dest.writeInt(this.press);
        dest.writeInt(this.power);
        dest.writeInt(this.stir);
        dest.writeInt(this.reverse);
        dest.writeInt(this.venting);
        dest.writeInt(this.time);
        dest.writeByte(this.condition);
    }

    protected ParamInfo(Parcel in) {
        this.funName = (short) in.readInt();
        this.fire = (short) in.readInt();
        this.press = (short) in.readInt();
        this.power = (short) in.readInt();
        this.stir = (short) in.readInt();
        this.reverse = (short) in.readInt();
        this.venting = (short) in.readInt();
        this.time = in.readInt();
        this.condition = in.readByte();
    }

}
